<?php
	
	class rankAction extends userAction {
		
		
		protected function _initialize() {
			parent::_initialize();
		}
		
		public function norank(){
			$u = safeRequest($_GET["u"]);
			if($this->userInfo->id == $u){
				$this->redirect("index","user");
			}else{
				$isFriend = isFriend($u,$this->userInfo->id);
				if("yes" == $isFriend){
					redirect(__APP__."/focus");
				}else{
					$record = D("user")->find($u);
					if($record){
						$this->assign("isFriend",$isFriend);
						$this->assign("user",$record);
						$this->display();
					}else{
						$this->error("不存在的用户");
					}
				}
			}
		}

		public function nosafe(){
			$this->error("不安全的操作");
		}
	}
?>